home *** CD-ROM | disk | FTP | other *** search
/ 9-Digit Zip Code Directory / 9-Digit Zip Code Directory (American Business Information) (ABIZIP-12).ISO / z4src.zip / BSBOOT.C < prev    next >
C/C++ Source or Header  |  1995-04-26  |  3KB  |  95 lines

  1. //----------------------------------------------------------------------------
  2. //                            MODULE DESCRIPTION
  3. //
  4. //  Module:    bsboot.c
  5. //   Title:    Base library
  6. //  Notice:    John M. Weeder
  7. //                 Copyright (c) 1993. All rights reserved.
  8. //             This module contains proprietary information and should be 
  9. //                treated as confidential.
  10. //
  11. //----------------------------------------------------------------------------
  12. //                           MAINTENANCE HISTORY
  13. //
  14. // $Workfile$
  15. // $Revision$
  16. //   $Author$
  17. //     $Date$
  18. //      $Log$    
  19. //
  20. //----------------------------------------------------------------------------
  21. //                             MODULE NARRATIVE
  22. //
  23. //
  24. //    This module contains code to reboot a computer.
  25. //
  26. //    The code in this module should be written entirely in C. 
  27. //    Do not use any C++ constructs.
  28. //
  29. //    This module is portable to:
  30. //        DOS 3.X+
  31. //        MS Windows 3.X+
  32. //        OS/2 2.X+
  33. //        OS/2 2.0 PM
  34. //        SCO UNIX.
  35. //
  36. //    The following compilers are supported:
  37. //        MSC 6.0A
  38. //        MSC/C++ 7.0
  39. //        Borland C++ 3.1 for DOS
  40. //        Borland C++ 1.0 for OS/2 2.X
  41. //        SCO UNIX cc
  42. //
  43. //----------------------------------------------------------------------------
  44. #include <bs.h>
  45.  
  46.  
  47. //----------------------------------------------------------------------------
  48. //   Description:    Boot computer
  49. //    Parameters:    fWarm        Warm boot?
  50. //       Returns:    
  51. //----------------------------------------------------------------------------
  52. VOID FN_E Boot(BOOL fWarm)
  53. {
  54. #if OS_DOS
  55.     void (far *bootsystem)(void);
  56.  
  57.    if (fWarm)                                    
  58.       {
  59.         unsigned far *warm = MK_FP (0x0000, 0x0472);
  60.         *warm = 0x1234;
  61.         Log(LOG_VERY_HIGH, "Warm boot.");
  62.         puts("\nWarm boot in progress...\n");
  63.       }
  64.    else
  65.         {
  66.         Log(LOG_VERY_HIGH, "Cold boot.");
  67.        puts ("\nCold boot in progress...\n");
  68.         }
  69.  
  70.     bootsystem = MK_FP (0xFFFF, 0x0000);
  71.    (*bootsystem) ();
  72. #else
  73.     NOTUSED(fWarm);
  74. #endif
  75.    return ;
  76. }
  77.  
  78.  
  79. //----------------------------------------------------------------------------
  80. //   Description:    Run standard test suite
  81. //    Parameters:    sTest        Test to run.
  82. //                                        0        Run all default tests (except).
  83. //       Returns:    TRUE if successful.
  84. //----------------------------------------------------------------------------
  85. #if COMPILE_TEST
  86. BOOL FN BootTest(SHORT sTest)
  87. {
  88.     Boot(sTest == 0);
  89.     return TRUE;
  90. }
  91. #endif
  92. //----------------------------------------------------------------------------
  93. //------------------------------- End of File --------------------------------
  94. //----------------------------------------------------------------------------
  95.